package com.kilomob.grady.handler;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

import com.kilomob.grady.codec.SendSerializeFrame;

public class MessageSendChannelInitializer extends ChannelInitializer<SocketChannel> {

    private SendSerializeFrame frame;
    private String id;
    private String protocol;

    public MessageSendChannelInitializer(String protocol,String id) {
        this.protocol = protocol;
        this.id = id;
        this.frame = new SendSerializeFrame();
    }
    

    protected void initChannel(SocketChannel socketChannel) throws Exception {
        ChannelPipeline pipeline = socketChannel.pipeline();
        frame.select(this.protocol,this.id, pipeline);
    }
}
